import java.util.Objects;
public class Solution {
    public boolean isPalindrome(int x) {
        if(x<0){
            return false;
        }
        String str = new String(x+"");
        StringBuilder builder = new StringBuilder();
        for(int i = str.length()-1;i>=0;i--){
            builder.append(str.charAt(i));
        }
        return Objects.equals(builder.toString(),str);
    }
}
